package com.example.anno;

import com.example.validation.StateValidation;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.*;

@Documented
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {StateValidation.class})
public @interface State {
    //提供校验失败的提示信息
    String message() default "state参数只能是发布、草稿、待审核、未通过、已发布";
    //指定校验分组
    Class<?>[] groups() default {};
    //指定负载
    Class<? extends Payload>[] payload() default {};

}
